import request from '@/utils/request'

// 查询查评分组列表
export function listGroping(query) {
  return request({
    url: '/system/groping/list',
    method: 'get',
    params: query
  })
}

// 查询查评分组详细
export function getGroping(id) {
  return request({
    url: '/system/groping/' + id,
    method: 'get'
  })
}

// 新增查评分组
export function addGroping(data) {
  return request({
    url: '/system/groping',
    method: 'post',
    data: data
  })
}

// 修改查评分组
export function updateGroping(data) {
  return request({
    url: '/system/groping',
    method: 'put',
    data: data
  })
}

// 删除查评分组
export function delGroping(id) {
  return request({
    url: '/system/groping/' + id,
    method: 'delete'
  })
}
// 查询查评分组列表
export function listGropingByProject(query) {
  return request({
    url: '/system/groping/listGropingByProject',
    method: 'get',
    params: query
  })
}
// 查询查评分组列表-----子列表
export function getListSon(id) {
  return request({
    url: '/system/groping/listSon/' + id,
    method: 'get'
  })
}// 查询查评分组列表-----子列表
export function getSubjectList(id) {
  return request({
    url: '/system/groping/getSubjectList/' + id,
    method: 'get'
  })
}
// 修改查评分组
export function updateGropingById(data) {
  return request({
    url: '/system/groping/updateGropingById',
    method: 'put',
    data: data
  })
}
// 查评记录
export function listGropingRecord(query) {
  return request({
    url: '/system/groping/listGropingRecord',
    method: 'get',
    params: query
  })
}
// 查评事件
export function getReviewEvents() {
  return request({
    url: '/system/groping/getReviewEvents',
    method: 'get',
  })
}
// 搜索卡片内容
export function getReviewEventsById(id) {
  return request({
    url: '/system/groping/getReviewEventsById/' + id,
    method: 'get'
  })
}
// 报告导出
export function exportTheReports(data) {
  return request({
    url: '/system/groping/exportTheReports',
    method: 'post',
    data: data,
    responseType: 'blob',
    timeout: 300000,
  })
}
// 事件类型
export function getDict() {
  return request({
    url: '/system/groping/getDict',
    method: 'get'
  })
}
// 查评事件
export function listGropingRecordTree() {
  return request({
    url: '/system/groping/listGropingRecordTree',
    method: 'get'
  })
}

// 问题整改
export function problemRectificationList(query) {
  return request({
    url: '/system/groping/problemRectificationList',
    method: 'get',
    params: query
  })
}
// 查评事件----问题整改列表
export function getReviewEventsByPro() {
  return request({
    url: '/system/groping/getReviewEventsByPro',
    method: 'get'
  })
}
// 查评事件----问题整改列表
export function getReviewEventsFist() {
  return request({
    url: '/system/groping/getReviewEventsFist',
    method: 'get'
  })
}
// 查评事件----问题整改列表
export function dimSelect(elementsId) {
  return request({
    url: '/system/groping/dimSelect/' + elementsId,
    method: 'get'
  })
}
